package com.qdu.bean;

import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class WeatherBean1 implements WritableComparable<WeatherBean1> {

    private int registered;
    private int casual;

    //空参构造
    public WeatherBean1() {
        this.registered=0;
        this.casual=0;
    }

    //序列化
    @Override
    public void write(DataOutput dataOutput) throws IOException {

        dataOutput.writeInt(registered);
        dataOutput.writeInt(casual);

    }

    //反序列化
    @Override
    public void readFields(DataInput dataInput) throws IOException {

        registered = dataInput.readInt();
        casual = dataInput.readInt();
    }

    //重写toString()方法
    @Override
    public String toString() {
        return  registered + "\t" + casual;
    }

    //setter
    public void set(int registered,int casual){
        this.registered = registered;
        this.casual = casual;
    }

    public int getRegistered() {
        return registered;
    }

    public int getCasual() {
        return casual;
    }

    @Override
    public int compareTo(WeatherBean1 o) {
        return 0;
    }
}
